/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
 * };
 */
class Solution {
public:

    int sum = 0;
    void Travel_In(TreeNode* node,TreeNode*  parent)
    {
        if(node == 0)
            return ;
        
        
        if(node->left == 0 && node->right == 0 && parent && parent->left == node)
            sum += node->val;
        Travel_In(node->left,node);
        Travel_In(node->right,node);
    }

    int sumOfLeftLeaves(TreeNode* root) {
        Travel_In( root , 0 );
        return sum;
    }
};